<div id="content" class="photos">
    <?if($data->photo->src): ?>
    <h1><?=$data->TITLE?></h1>
    <div class="photo">
        <div class="normal">
        <a href="/photos/photo/<?=$data->photo->ID?>" target="_blank" title="<?=$data->photo->caption?>">
            <img src="http://<?=COOKIELESS.'/'.$data->photo->src?>" alt="<?=$data->photo->caption?>" />
        </a>
        </div>
        <p class="info">
            <span class="caption"><?=$data->photo->caption?></span>
            <span class="albumName">
                <?=_('Owner')?>: <a href="<?=$data->photo->account->url?>" target="_blank" title="<?=$data->photo->account->fullname?>"><?=$data->photo->account->fullname?></a>
            </span>
            <span class="clear"></span>
        </p>
        <div class="check">
            <a class="delete" href="javascript:del(<?=$data->photo->ID?>);" title="<?=_('Delete photo')?>"><?=_('Delete')?></a>
            <a class="approve" href="javascript:approve(<?=$data->photo->ID?>);" title="<?=_('Approve photo')?>"><?=_('Approve')?></a>
        </div>
        <div class="clear"></div>
       
    </div>
    <? else:?>
        <h1><?=$data->DESCRIPTION?></h1>
        <p><?=_('The page you requested cannot be displayed at the moment. It may be temporarily unavailable, the link you clicked on may have expired, or you may not have permission to view this page.')?></p>
        <a href="/" title="<?=_('Return home')?>"><?=_('Return home')?></a>
    <? endif; ?>
<div class="clear"></div>
</div>
<div id="aside">
    <?include 'apps/home/template/_home_flank.html'?>
</div>
<script type="text/javascript">
function del(ID){
    tool.confirm("<?=_('Confirm')?>","<?=_('Are you sure you want to `delete` the photo?')?>",'_del(\''+ID+'\')');
}
function _del(ID){
    tool.post({'url':'/json/photos/editorial,check/delete',
        'data':'photoID='+ID,
        'onComplete':function(e){
                if(e.code==200)	location.href = location.href;
                else return tool.result(400,'<?=_('Alert')?>','<?=_('Please try again later..')?>');
        }
    });
}
function approve(ID){
    tool.post({'url':'/json/photos/editorial,check/approve',
        'data':'photoID='+ID,
        'onComplete':function(e){
                if(e.code==200)	location.href = location.href;
                else return tool.result(400,'<?=_('Alert')?>','<?=_('Please try again later..')?>');
        }
    });
}
</script>